diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6cbeab77d..21cf6b44a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -329,7 +329,12 @@ if(USE_CAMERA_SUPPORT)
 endif(USE_CAMERA_SUPPORT)
 
 if(USE_OPENEXR)
-  find_package(OpenEXR)
+  find_package(OpenEXR 3.0 CONFIG)
+  if(TARGET OpenEXR::OpenEXR)
+    set(OpenEXR_LIBRARIES OpenEXR::OpenEXR)
+  else()
+    find_package(OpenEXR)
+  endif()
   if(OpenEXR_FOUND)
     include_directories(SYSTEM ${OpenEXR_INCLUDE_DIRS})
     list(APPEND LIBS ${OpenEXR_LIBRARIES})
